package org.wit.ecommerce.domain;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

/**
 * 
 * @author brown.hu, Justin
 *
 */
@Entity
@Table(name="jec_user")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="usertype", discriminatorType=DiscriminatorType.STRING)
public class User implements Serializable {
	private static final long serialVersionUID = -1590407395999301893L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	
	@Column(length=50, nullable=false)
	private String email;	
	
	@Column(length=32, nullable=false)
	private String password;
	
	@Column(length=20, nullable=false)
	private String mobilePhone;
	
	@Column(length=30, nullable=false)
	private String firstName;
	
	@Column(length=30)
	private String midName;
	
	@Column(length=30, nullable=false)
	private String lastName;
	
	@Column(length=50, nullable=false)
	private String country;
	
	@Column(name="province", length=50, nullable=false)
	private String state;	//province
	
	@Column(length=50)
	private String city;	
	
	@Column(length=200)
	private String address;
	
	@Column(length=10)
	private String zip;
	
	@Column(nullable=false, updatable=false)
	private Timestamp createDate;
	
	@Column(nullable=false)
	private int status;
	public static final int DISABLED = 0;
	public static final int ENABLED = 1;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getMobilePhone() {
		return mobilePhone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getMidName() {
		return midName;
	}

	public void setMidName(String midName) {
		this.midName = midName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getZip() {
		return zip;
	}

	public void setZip(String zip) {
		this.zip = zip;
	}

	public Timestamp getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getStatus() {
		return status;
	}	
}
